/**
 * 
 */
package com.smarttest.common.beans.protolcol;

/**
 * GPS基础消息包
 * @author Administrator
 *
 */
abstract public class GpsMessage {
	protected String imei;
	protected int mactype;
	
	abstract public Location getLocation() throws Exception;

	protected String getBinaryString(byte b) {
		String rs = Integer.toBinaryString(b & 0xFF);
		while (rs.length() < 8) rs = "0" + rs;
		return rs;
	}
	
	protected int getBit(byte b, int idx) {
		return (b >> idx) & 0x1;
	}
	
	public String getImei() {
		return imei;
	}
	public int getMactype() {
		return mactype;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public void setMactype(int mactype) {
		this.mactype = mactype;
	}
}